<template>
  <router-link to="/home" custom v-slot="{ navigate }">
    <span @click="navigate">首页</span>
  </router-link>
  <router-link to="/about" custom v-slot="{ navigate }">
    <span @click="navigate">关于我们</span>
  </router-link>
  <router-view v-slot="{ Component, route }">
    <transition>
      <keep-alive>
        <component :is="Component" v-bind="route"></component>
      </keep-alive>
    </transition>
  </router-view>
</template>

<script lang="ts">
import { defineAsyncComponent, defineComponent, getCurrentInstance, provide, reactive, readonly, ref, toRefs } from 'vue'
import HelloWorld from './components/HelloWorld.vue'
import Tele from './components/teleport.vue'
import ModelSync from './components/modelSync.vue'
import ForRefs from './components/forRefs.vue'
export default defineComponent({
  name: 'App',
  components: {
    // HelloWorld,
    // Tele,
    // Suspen: defineAsyncComponent(() => import('./components/suspense.vue')),
    // ModelSync,
    // ForRefs
  },
  setup() {
    // const appState = reactive({ appId: '12adfdsf' })
    // provide('appState', readonly(appState))
    
    return {}
  },
})
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
